package day07home;

import java.util.Scanner;

public class Guess {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = (int) (Math.random() * 100);
        System.out.println(num);
        while (true) {
            System.out.println("开始猜吧");
            int guess = scan.nextInt();
            if (guess > num) {
                System.out.println("你猜的数字太大了哦");
            } else if (guess < num) {
                System.out.println("你猜的数字太小了哦");
            } else {
                System.out.println("恭喜你，猜对啦！");
                break;
            }

        }
    }

}
